package com.xt.purchasingsystem.controller.stockManagement;

import com.xt.purchasingsystem.dto.DFileDto;
import com.xt.purchasingsystem.model.SCell;
import com.xt.purchasingsystem.service.stockManagementService.SafetyInventoryConfigurationManageService;
import com.xt.purchasingsystem.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 库存管理-->安全库存配置管理的所有接口
 * Author: 老姚
 * Date:  2020/3/22 17:39
 */

@RestController

@RequestMapping(value = "/safetyInventConfigManagement")
public class SafetyInventoryConfigurationManageController {
    @Autowired
    private SafetyInventoryConfigurationManageService safetyInventoryConfigurationManageService;

    //多条件分页查询所有未分配库存的产品档案
    @PostMapping("/getAllDFileByUnallocatedInventory")
    public Result getAllDFileByUnallocatedInventory(@RequestBody DFileDto dFileDto) {
        return safetyInventoryConfigurationManageService.queryAllDFileByUnallocatedInventory(dFileDto);
    }

    //提交安全库存配置单的接口
    @PostMapping("/addSafetyInventoryConfiguration")
    public Result addSafetyInventoryConfiguration(@RequestBody SCell sCell) {
        return safetyInventoryConfigurationManageService.addSafetyInventoryConfiguration(sCell);
    }

    //分页获取所有未审核的库存配置单的接口
    @GetMapping("/getAllUnreviewedScellByPage/{currNo}/{pageSize}")
    public Result getAllUnreviewedScellByPage(@PathVariable Integer currNo, @PathVariable Integer pageSize) {
        return safetyInventoryConfigurationManageService.getAllUnreviewedScellByPage(currNo, pageSize);
    }

    //审核库存配置单的接口
    @PutMapping("/reviewSafetyInventoryConfiguration")
    public Result reviewSafetyInventoryConfiguration(@RequestBody SCell sCell) {
        return safetyInventoryConfigurationManageService.reviewSafetyInventoryConfiguration(sCell);
    }


}
